<?php

class Zend_View_Helper_ShowMsg{
	
	public function showMsg($msg, $url = 'javascript:history.back(-1);'){
		
		$urlArray=explode('/',CURRENT_URL);
		
		$urlArray=explode('-',array_pop($urlArray));
		
		if($urlArray[0]=='administrator'){
			
			$alert='提示框';

			$message='自动跳转到您所需的页面';
			
		}else{
			
			$alert='Tips';
			
			$message='Get me there right now.';
			
		}
		
		if ($urlArray[0] == 'adminb') {
			$width = "700px";
		} else {
			$width = "950px";
		}
		
		echo '<div class="centerDiv" style="background:#f8f8f8;width: ' .$width. ';margin: 5px auto;text-align: center;padding: 10px 0;line-height: 22px;">';
		echo '<div class="w-blk0 w-blk-loading" style="margin: 0 auto;">';
		echo '<h2 class="blk0h2 f-iblk clearfix">';
		echo '<span class="spbg blkhdl">'.$alert.'</span>';
		echo '</h2>';
		echo '<div class="blkbody">';
        echo '<div class="inner-box">';
        echo $msg . '<br/>';
        echo '<a href="' . $url . '">' . $message . '</a>';
        echo '</div></div></div></div>';
		echo '<script>setTimeout(function(){window.location.href="'.$url.'"},"3000");</script>';
	}

}

